package mysql

import (
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func connectMySQL() (*gorm.DB, error) {
	dsn := "chenyusen:X1sNUkg5z7gddvme@tcp(mysql.sqlpub.com:3306)/reggie_takeout?charset=utf8mb4&parseTime=True&loc=Local"
	db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
	if err != nil {
		return nil, fmt.Errorf("failed to connect database: %w", err)
	}
	return db, nil
}

